package com.jzo2o.customer.controller.operation;

import com.alibaba.nacos.api.model.v2.Result;
import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.AgencyCertificationAuditResDTO;
import com.jzo2o.customer.service.IAgencyCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author: LiuLi
 * @Date: 2025/09/18 下午12:05
 * @Description: 运营端 - 机构认证审核相关接口
 */
@RestController("operationAgencyCertificationAuditController")
@RequestMapping("operation/agency-certification-audit")
@Api(tags = "运营端 - 机构认证审核相关接口")
public class AgencyCertificationAuditController {

    @Resource
    private IAgencyCertificationAuditService agencyCertificationAuditService;

    /**
     * 审核机构申请分页查询
     *
     * @param queryDTO 查询参数
     * @return 分页结果
     */
    @GetMapping("/page")
    @ApiOperation("审核机构申请分页查询")
    public PageResult<AgencyCertificationAuditResDTO> page(@ModelAttribute AgencyCertificationAuditPageQueryReqDTO queryDTO) {
        return agencyCertificationAuditService.pageQuery(queryDTO);
    }

    /**
     * 审核机构认证信息
     *
     * @param id                 认证审核id
     * @param certificationStatus 认证状态
     * @param rejectReason       驳回原因
     * @return 操作结果
     */
    @PutMapping("/audit/{id}")
    @ApiOperation("审核机构认证信息")
    public void audit(@PathVariable("id") Long id,
                               @RequestParam("certificationStatus") Integer certificationStatus,
                               @RequestParam("rejectReason") String rejectReason) {
       agencyCertificationAuditService.audit(id, certificationStatus, rejectReason);

    }
}